package com.pxxy.yuyi.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.pxxy.yuyi.dao.EmploymentDao;
import com.pxxy.yuyi.entity.Employment;
import com.pxxy.yuyi.service.EmploymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by IntelliJ IDEA
 *
 * @Author : XuWen
 * @create 2021/6/20 22:32
 */
@Service
public class EmploymentServiceImpl implements EmploymentService {
    @Autowired
    private EmploymentDao employmentDao;

    @Override
    public Integer insertemployment(Employment employment) {
        return employmentDao.insertemployment(employment);
    }

    @Override
    public PageInfo<Employment> showEmploy(Integer pageNum) {
        PageHelper.startPage(pageNum,6);
        List<Employment> list = employmentDao.selectAll();
        return new PageInfo<Employment>(list);
    }

    @Override
    public void deleteEmployment(Integer eid) {
        employmentDao.deleteEmployment(eid);
    }
}
